<?php

/**
 * @Author: wuchenge
 * @Date: 2020-12-07 10:51:03
 * @email: ligui0506@sina.com
 * @descript: 权限节点验证器
 */

namespace App\Requests\rbac;

use App\Requests\FormRequest;

class NodeRequest extends FormRequest
{
    public function rules()
    {
        // 默认
        return [
            'name'  => 'required',
            'pid'   => 'required',
            'title' => 'required',
            'sort'  => 'required',
        ];
    }

    public function messages()
    {
        return [
            'name.required'  => 100201,
            'pid.required'   => 100202,
            'sort.required'  => 100203,
            'title.required' => 100204,
        ];
    }

    public $scene = [
        'admin.rbac.node.modify' => ['name', 'pid', 'sort', 'title'],
    ];
}
